import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';

//模型活动管理单条查询
export const queryBizModelActivity = (params) => {
  params.head.transCode = 'queryBizModelActivity';
  return request({
    url: '/biz/model/bizModelActivity/queryBizModelActivity',
    method: 'post',
    data: params
  })
}
//模型活动管理多条列表查询，支持条件查询
export const queryBizModelActivityListPage = (params) => {
  params.head.transCode = 'queryBizModelActivityListPage';
  return request({
    url: '/biz/model/bizModelActivity/queryBizModelActivityListPage',
    method: 'post',
    data: params
  })
}
//模型活动管理新增单条记录
export const saveBizModelActivity = (params) => {
  params.head.transCode = 'saveBizModelActivity';
  return request({
    url: '/biz/model/bizModelActivity/saveBizModelActivity',
    method: 'post',
    data: params
  })
}
//模型活动管理新增多条记录
export const saveBizModelActivityList = (params) => {
  params.head.transCode = 'saveBizModelActivityList';
  return request({
    url: '/biz/model/bizModelActivity/saveBizModelActivityList',
    method: 'post',
    data: params
  })
}
//模型活动管理新增或修改单条记录
export const saveOrUpdateBizModelActivity = (params) => {
  params.head.transCode = 'saveOrUpdateBizModelActivity';
  return request({
    url: '/biz/model/bizModelActivity/saveOrUpdateBizModelActivity',
    method: 'post',
    data: params
  })
}


//模型活动管理新增或修改单条记录
export const saveOrUpdateBizModelActivityList = (params) => {
  params.head.transCode = 'saveOrUpdateBizModelActivityList';
  return request({
    url: '/biz/model/bizModelActivity/saveOrUpdateBizModelActivityList',
    method: 'post',
    data: params
  })
}

//模型活动管理修改单条记录
export const updateBizModelActivity = (params) => {
  params.head.transCode = 'updateBizModelActivity';
  return request({
    url: '/biz/model/bizModelActivity/updateBizModelActivity',
    method: 'post',
    data: params
  })
}

//模型活动管理删除单条记录
export const deleteBizModelActivity = (params) => {
  params.head.transCode = 'deleteBizModelActivity';
  return request({
    url: '/biz/model/bizModelActivity/deleteBizModelActivity',
    method: 'post',
    data: params
  })
}

//模型活动管理删除多条记录
export const deleteBizModelActivityList = (params) => {
  params.head.transCode = 'deleteBizModelActivityList';
  return request({
    url: '/biz/model/bizModelActivity/deleteBizModelActivityList',
    method: 'post',
    data: params
  })
}
//模型活动管理导出excel
export const exportBizModelActivityExcel = (params) => {
  downloadExcel({
    url: '/biz/model/bizModelActivity/excelDownload/exportBizModelActivityExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
